<ul class="sidemenu">
<?php
$activePrinted = false;
foreach ($this->container as $page) :
    if (!$this->navigation()->accept($page)) {
    	continue;
    }
    $isActive = $page->isActive(true);
?>
<li<?php echo ($isActive && !$activePrinted) ? ' class="active"' : ''; ?>>
    <a href="<?php echo $page->getHref(); ?>">
	<?php
        if (isset($page->img)) {
            echo '<img src="' . $this->imageLink($page->img['src']) . '" alt="' . (isset($page->img['alt']) ? $page->img['alt'] : '') . '" />';
        }
    ?>
    <?php echo $page->getLabel(); ?>
    </a>
</li>
<?php if ($isActive):
        $activePrinted = true;
    endif; ?>
<?php endforeach; ?>
</ul>
